<!-- navigationBar组件 -->
<template>
	<view class='flex commonHead' :style="[{'color':myProperty.color?myProperty.color:'#000'},{'background-color':myProperty.bg_color?myProperty.bg_color:'white'},{'height':HeadHeight.titleHeight*2+'rpx'}]">
		<view class='commonHead-wrap flex'>
			<!-- 0:无返回；1：返回上一级；2：home -->
			<view class='commonHead_left'>
				<view v-if="myProperty.flag==1" class='commonHead_left_back' @click='commonHead_left_back'>
					<image class="back" src="../../static/images/backBlack.png"></image>
				</view>
				<view v-if="myProperty.flag==2" class='commonHead_left_back' @click='commonHead_left_back'>
					<image class="backCircle" src="../../static/images/backCircle.png"></image>
				</view>
				<view v-if="myProperty.flag==4" class='commonHead_left_back' @click='commonHead_left_back'>
					<image class="back" src="../../static/images/back.png"></image>
				</view>
				<view v-if="myProperty.flag==3" class='commonHead_left_back' @click='commonHead_left_home'>
					<image class="back" src="../../static/images/index.png" style="width:34rpx;height:34rpx;"></image>
				</view>
				<view v-if="myProperty.flag==5" class='commonHead_left_back' @click='commonHead_left_search'>
					<image class="back" src="../../static/images/searchHall.png" style="width:34rpx;height:34rpx;"></image>
				</view>
			</view>
			<view class='commonHead_right flex'>
				<view class='commonHead_right_text line1'>{{myProperty.name?myProperty.name:"我是标题"}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	var app = getApp();
	export default {
		props: {
			myProperty: {
				type: Object,
				value: {
					"bg_color": "white",
					"color": "#000",
					"flag": 1,
					"name": "我是标题"
				},
				isUrl: {
					type: String,
					value: '1'
				}
			},
			commonHeadHeight: {
				type: Object,
				value: {}
			}
		},
		data() {
			return {
				HeadHeight: {}
			}
		},
		created: function() {
			console.log(this.myProperty)
			var that = this;
			that.HeadHeight.titleHeight = app.globalData.titleHeight
			console.log(that.HeadHeight)
		},
		methods: {
			commonHead_left_back: function() {
				app.globalData.bgAudioMannager.stop();
				uni.navigateBack();
			},
			commonHead_left_home: function() {
				uni.reLaunch({
					url: '/pages/hall/hall'
				})
			},
			commonHead_left_search: function() {
				uni.navigateTo({
					url: '/packageA/pages/search/search'
				})
			},
		}
	}
</script>

<style scoped>
	@import "./navigationBar.css"
</style>
